package model.oanda;

import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Order implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -3801000921811054159L;
	private Long id;
	private String instrument;
	private Long units;
	private String side;
	private String type;
	private String time;
	private Float price;
	private Float takeProfit;
	private Float stopLoss;
	private String expiry;
	private Long upperBound;
	private Long lowerBound;
	private Long trailingStop;
	
	public static final String SELL="sell";
	public static final String BUY="buy";

	private TradeOpened tradeOpened;
	
	public Order(){
		this(null,0l,null);
	}

	public Order(String instrument, long units, String side) {
		super();
		this.instrument=instrument;
		this.units=units;
		this.side=side;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getInstrument() {
		return instrument;
	}

	public void setInstrument(String instrument) {
		this.instrument = instrument;
	}

	public Long getUnits() {
		return units;
	}

	public void setUnits(Long units) {
		this.units = units;
	}

	public String getSide() {
		return side;
	}

	public void setSide(String side) {
		this.side = side;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}



	public String getExpiry() {
		return expiry;
	}

	public void setExpiry(String expiry) {
		this.expiry = expiry;
	}

	public Long getUpperBound() {
		return upperBound;
	}

	public void setUpperBound(Long upperBound) {
		this.upperBound = upperBound;
	}

	public Long getLowerBound() {
		return lowerBound;
	}

	public void setLowerBound(Long lowerBound) {
		this.lowerBound = lowerBound;
	}

	public Long getTrailingStop() {
		return trailingStop;
	}

	public void setTrailingStop(Long trailingStop) {
		this.trailingStop = trailingStop;
	}

	public TradeOpened getTradeOpened() {
		return tradeOpened;
	}

	public void setTradeOpened(TradeOpened tradeOpened) {
		this.tradeOpened = tradeOpened;
	}

	@JsonIgnoreProperties(ignoreUnknown = true)
	public static class TradeOpened{
		private Long id;
	    private Long units;
	    private String side;
	    private Long takeProfit;
	    private Long stopLoss;
	    private Long trailingStop;

		public Long getId() {
			return id;
		}
		public void setId(Long id) {
			this.id = id;
		}
		public Long getUnits() {
			return units;
		}
		public void setUnits(Long units) {
			this.units = units;
		}
		public String getSide() {
			return side;
		}
		public void setSide(String side) {
			this.side = side;
		}
		public Long getTakeProfit() {
			return takeProfit;
		}
		public void setTakeProfit(Long takeProfit) {
			this.takeProfit = takeProfit;
		}
		public Long getStopLoss() {
			return stopLoss;
		}
		public void setStopLoss(Long stopLoss) {
			this.stopLoss = stopLoss;
		}
		public Long getTrailingStop() {
			return trailingStop;
		}
		public void setTrailingStop(Long trailingStop) {
			this.trailingStop = trailingStop;
		}
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public Float getTakeProfit() {
		return takeProfit;
	}

	public void setTakeProfit(Float takeProfit) {
		this.takeProfit = takeProfit;
	}

	public Float getStopLoss() {
		return stopLoss;
	}

	public void setStopLoss(Float stopLoss) {
		this.stopLoss = stopLoss;
	}
}
